package library.qrcode.zxing;

import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

import library.qrcode.R;


/**
 * Created by Dell on 2016/7/15.
 */
public class ScanQRActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_scan_qr);

        FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager
                .beginTransaction();
        Fragment fragment = new QRScanFragment();
        fragmentTransaction.replace(R.id.realtabcontent, fragment);
        fragmentTransaction.commit();

    }
    public void setSN(String result) {
        QrCodeHelper.result(result);
        finish();
    }
}
